<?php
class ORMProduceEvent extends ORMBase {
  public function __construct() {
    parent::__construct('ProduceEvent');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->produce_trackId = isset($object->produce_trackId) ? $object->produce_trackId : '';
    $epObject->date = (isset($object->date) && $object->date) ? SimpleDate::toStamp($object->date) : 0;
    $epObject->userAccount = isset($object->userAccount) ? $object->userAccount : '';
    $epObject->sourceId = isset($object->sourceId) ? $object->sourceId : 0;
    $epObject->targetId = isset($object->targetId) ? $object->targetId : 0;
    $epObject->extra = isset($object->extra) ? $object->extra : '';
    $epObject->overdueReason = isset($object->overdueReason) ? $object->overdueReason : '';
    $epObject->isExpired = isset($object->isExpired) ? $object->isExpired : 0;
    $epObject->admAppr = isset($object->admAppr) ? $object->admAppr : 0;
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->produce_trackId = $epObject->produce_trackId;
    $object->date = ($epObject->date != 0) ? SimpleDate::fromStamp($epObject->date) : 0;
    $object->userAccount = $epObject->userAccount;
    $object->sourceId = $epObject->sourceId;
    $object->targetId = $epObject->targetId;
    $object->extra = $epObject->extra;
    $object->overdueReason = $epObject->overdueReason;
    $object->isExpired = $epObject->isExpired;
    $object->admAppr = $epObject->admAppr;
    return $object;
  }
}
?>
